-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Matcher Support for Headers #72
Conversation
c83ae45
to
823031f
Compare
823031f
to
d46654d
Compare
throw new AssertionError("Missing header " + headerMatcher.getKey()); | ||
} | ||
|
||
headerMatcher.getValue() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a bit messy. Can someone take a look at this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
have you run into some concurrent issues that we need a ConcurrentHashMap and a lock object?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not at the moment. But I suspect we'll run into some issues when using JUnit's 5 Parallelized Tests.
I can remove it if you think it's best.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, please. if we face these issue we'll have to find out some other solutions how to handle concurrency.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, i was on vacation. Just updated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no worries 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the idea but handling the concurrency seems like an overkill
ResponseDefinitionBuilder headers(Map<String, String> additionalHeaders); | ||
default ResponseDefinitionBuilder headers(Map<String, String> additionalHeaders) { | ||
additionalHeaders | ||
.forEach((k, v) -> header(k, Matchers.equalToIgnoringCase(v))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it seems to me too relaxed to ignore the case for the value by default. I would stick with equalTo
letting the developers choose themselves if they want to ignore the case
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good job! thanks!
Attempt at implementing #1